var app = getApp();
Page({
  data: {
    imgUrls: [],
    image: '',
    phoneNumber:'',
    context: '',
    head:'寻物启事',
    name:'',
    indicatorDots: false,
    autoplay: false,
    interval: 5000,
    duration: 1000
  },
  changeIndicatorDots: function (e) {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },
  changeAutoplay: function (e) {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },
  intervalChange: function (e) {
    this.setData({
      interval: e.detail.value
    })
  },
  durationChange: function (e) {
    this.setData({
      duration: e.detail.value
    })
  },
  
onLoad: function(options) {
  var that = this;
  var secondId = options.lostId;
  wx.request({
    url: app.globalData.urlPath + "getLostFoundById.action", //仅为示例，并非真实的接口地址
    data: { 
      id: lostId 
     },
    header: {
      'content-type': 'application/json' // 默认值
    }, success: function (res) {
      console.log(res.data.images)
      if(res.data.type == 0){
        that.data.head = '寻物启事'
      }else{
        that.data.head = '捡到告示'
      }
      that.setData({
        name: res.data.contact,
        phoneNumber: res.data.telephone,
        context: res.data.content,
        image:  res.data.images,
      })
      var urlArray = [];
      urlArray = that.data.image.split(';')
      for (var i = 0; i < urlArray.length; i++) {
        urlArray[i] = app.globalData.imgPath + urlArray[i];
      }
      that.setData({
        imgUrls: urlArray
      })
      console.log("ok" + that.data.imgUrls[1]);
    },
    
  })

},

getImage:function(){
  that.data.imgUrls = that.data.image.split(';');
  
}


})